<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
  <head>
    <base href="<%=basePath%>">
    <meta charset="utf-8">
    <title>处理用户的注册请求</title>
  </head>
  
  <body>
    <%
      //post请求如果出现中文乱码
      //设置请求的字符编码
      request.setCharacterEncoding("UTF-8");
      String userName=request.getParameter("userName"); 
      //get请求如果出现中文乱码
      //userName=new String(userName.getBytes("ISO-8859-1"),"UTF-8");
      String userPwd=request.getParameter("userPwd");
      //get请求如果出现中文乱码
      //userPwd=new String(userPwd.getBytes("ISO-8859-1"),"UTF-8");
      String email=request.getParameter("email");
      //获取表单组件对应多个值时的请求数据 
      String[] interest=request.getParameterValues("interest");
    %>
    <h1>用户的注册信息如下：</h1>
    <h2>用户名：<%=userName %></h2>
    <h2>密码：<%=userPwd %></h2>
    <h2>电子邮箱：<%=email %></h2>
    <h2>爱好：<%=Arrays.toString(interest) %></h2>
  </body>
</html>
